from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_list, object_detail

from .models import Note
from .views import create, update, notejson, livepage, livepagejson

notes = Note.objects.all()

urlpatterns = patterns(
    '',
    (r'^$', object_list, dict(queryset=notes)),
    (r'^livepage/$', livepage),
    (r'^livepagejson/$', livepagejson),
    (r'^getjson/$', notejson),
    (r'^note/(?P<slug>[-\w]+)/$', object_detail, dict(queryset=notes, slug_field='slug')),
    (r'^note_create/$',  create),
    (r'^note/(?P<slug>[-\w]+)/update/$', update)
    )
